package com.hsshy.beam.kafka.controller;
import com.hsshy.beam.common.utils.R;
import com.hsshy.beam.kafka.service.KafkaSender;
import com.hsshy.beam.sys.entity.SysConfig;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @description: kafka演示
 * @author: hs
 * @create: 2019-04-03 10:13:12
 **/
@RequestMapping(value = "/kafka")
@RestController
@Api(value = "KafkaController",tags = "KafkaController")
public class KafkaController {

    @Autowired
    private KafkaSender kafkaSender;

    @ApiOperation(value = "测试")
    @GetMapping(value = "/test")
    public R test(){

        kafkaSender.sendChannelMess("testTopic","caonima");

        SysConfig sysConfig = new SysConfig();
        sysConfig.setParamKey("11111");

        kafkaSender.sendChannelMap("test2",sysConfig);
        return R.ok();

    }


}
